﻿#region "Copyright (C) Lenny Granovsky. 2005-2013"
//This program is free software distribute under the terms of the GNU General Public License as published by
//the Free Software Foundation. Please read AssemblyInfo.cs file for more information.
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Web.Enhancements.Rest.Templates
{
    internal class JavaScriptTemplateGenerator
    {
        public JavaScriptTemplateGenerator()
        { 
        }

        public static string GenerateTemplate(JavaScriptTemplateType templateType)
        {
            return GenerateTemplate(templateType, "");
        }

        public static string GenerateTemplate(JavaScriptTemplateType templateType, string parameter)
        {
            string template = JSTemplates.ResourceManager.GetString(string.Format("{0}JSTemplate", templateType.ToString()));
            switch (templateType)
            {
                case JavaScriptTemplateType.PopulateDivWithHtml:
                    template = template.Replace("@@param0", parameter);
                    break;
            }
            return template;
        }
    }
}
